
maxlen = 10000

a = reduce(lambda a, b:a * 10, xrange(maxlen), 1)
print len(str(a))

def reclen(n):
    n = str(a / n)
    for l in range(1, maxlen / 2):
        if n[:l] == n[l:l*2]:
            return l
    else:
        return 0

print 7, reclen(7)

t = []
for i in range(2, 1000, 1):
    t.append((reclen(i), i))

print max(t)